<?php


namespace common\model;


use think\model\RelationModel;

class EntityEpisodeRelationModel extends RelationModel
{
// 自动验证
    protected $_validate = [
        ['entity_id', '', '', self::EXISTS_VALIDATE, 'integer'],
        ['entity_module_id', '', '', self::EXISTS_VALIDATE, 'integer'],
        ['episode_id', '', '', self::EXISTS_VALIDATE, 'integer'],
    ];

    // 自动完成
    protected $_auto = [
        ['created', 'time', self::MODEL_INSERT, 'function'],
    ];

    // 自动完成后验证
    protected $_validate_after_auto = [
        ['entity_id,episode_id,showings_number', '', '', self::MUST_VALIDATE, 'unique'],
    ];
}